package com.itheima.web.job;

import cn.hutool.core.date.DateUtil;
import com.itheima.service.db.AnalysisByDayService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class AnalysisJob {

    @Reference
    private AnalysisByDayService analysisByDayService;

    @Scheduled(cron = "0 0 0/1 * * ?")
    // @Scheduled(cron = "0 0/1 * * * ?")
    public void handlerAnalysis() {
        analysisByDayService.saveAnalysis();
        System.out.println(DateUtil.formatDateTime(new Date()) + "日志统计处理已完成。。。");
    }
}
